package org.example.myerp.controller;

import com.mycloud.api.pojo.ApiGoods;
import org.example.myerp.pojo.MakeHouse;
import org.example.myerp.pojo.PageMyself;
import org.example.myerp.service.MyFeginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/design/myfign")
public class MyFeginController {
    @Autowired
    MyFeginService myFeginService;

    @RequestMapping("/makeHousePage")
        ///design/myfign
    PageMyself<MakeHouse> makeHousePagefindByPager(@RequestParam(value = "pageSize") Integer pageSize, @RequestParam(value = "pageNum") Integer pageNum) {
        return myFeginService.makeHousePagefindByPager(pageSize, pageNum);
    }

    @RequestMapping("/updateInfoRepby")
    public void updateInfoRepby(@RequestParam("product_id") Integer product_id) {
        myFeginService.updateInfoRepby(product_id);
    }

    @RequestMapping("/goodsfindByPager")
    public PageMyself<ApiGoods> goodsfindByPager(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize) {
        return myFeginService.goodsfindByPager(pageNum, pageSize);
    }

    @RequestMapping("/goodsfindByPagers")
    public PageMyself<ApiGoods> goodsfindByPagers(@RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize) {
        return myFeginService.goodsfindByPagers(pageNum, pageSize);
    }

    @RequestMapping("/fanGoods")
    public List<ApiGoods> fanGoods(@RequestParam("productId") List<Integer> productId) {
        return myFeginService.fanGoods(productId);
    }

}
